<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>03.grid</title>
		<link rel="stylesheet" type="text/css" href="ext2/resources/css/ext-all.css" />
	    <link rel="stylesheet" type="text/css" href="ext2/resources/css/xtheme-slate.css" />
		<link rel="stylesheet" type="text/css" href="util/ext-patch.css" />
		<link rel="stylesheet" type="text/css" href="util/My-all.css" />
		<script type="text/javascript" src="ext2/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="ext2/ext-all.js"></script>
		
		
		<script type="text/javascript" src="ext2/Ext.ux.Notification.js"></script>
	    <script type="text/javascript" src="util/formUtil.js"></script>
		<script type="text/javascript" src="util/MyUtil.js"></script>
		<script type="text/javascript" src="util/pPageSize.js"></script>
		<script type="text/javascript" src="util/MyGrid.js"></script>
		
		<script type="text/javascript">
Ext.onReady(function() { 

	 Ext.QuickTips.init();
	    
	 Ext.form.Field.prototype.msgTarget = 'side';
	 var gridStructure = [// grid的数据结构   
			 { header : '序号', name : 'id',type:'label',addIsShow:false,editIsReadOnly:true}, 
			 { header : '姓名',name : 'name'}, 
			 { header : '性别', name : 'sex', type:'combo',fobj:[{value:1,text:"男"},{value:2,text:"女"}]}
	 ];
	 var myUxGrid = new Ext.ux.grid.MyGrid({// 创建封装的MyGrid对象  
	 	 url : 'person!show.action',   
	 	 selectType : 'check',   // dataObject : myGridData, //
	 	 defaultSortField : 'id',   //
	 	 keyField : 'id', 
 	     structure : gridStructure,  
 	     autoScroll : true,
 	     region:"center",
 	     needGroup : false,
 	     addUrl:"person!add.action",
 	     updateUrl:"person!update.action",
 	     delUrl:"person!delete.action",
 	     exportUrl:"person!exportTableToExcel.action",
 	     // 分组的字段名称
		 myGroupField : 'id',
		 viewConfig: new Ext.grid.GridView({
				forceFit : true
		 }),
 	     findField:'id',
 	     title : 'grid测试',   
         tablename : 'person'
    
    }); 
	new Ext.TabPanel({
						height:500,
						autoWidth : true,  
						renderTo:Ext.getBody(),
					    activeTab: 0,
					    border:false,
					    items: [myUxGrid,{
					        title: 'Tab 2',
					        html: 'Another one'
					    }]
	})
}); 


        </script>
	</head>
	<body>
			<form action="" method="post" name="ExportForm" id="ExportForm" style="display: none;">
			<input name="exportData" id="exportData" type="hidden"/>
			<input name="exportFileName" id="exportFileName" type="hidden" />
  	</form>
	</body>
</html>
